<template>
  <div class="write-box">
    <div class="bar">工具箱</div>
    <!-- :disabled="this.flag==='1'" -->
    <textarea name="" id="" cols="30" rows="5" v-model="message" @keydown.enter="sendMessage"></textarea>
    <button class="btn" @click="sendMessage">发送</button>
  </div>
</template>

<script>
export default {
   
  data() {
    return {
        message:'',
    };
  },
  mounted() {
            //   this.flag=this.userInfo.username

    
  },
  watch: {
      message(){
        console.log(this.message)  
      }
  },
  methods: {
      sendMessage(){
          console.log(this.message);
          this.$emit('sendmessage',this.message)
          this.message=''
          
          
      }
  },
  components: {}
};
</script>

<style scoped>
.write-box {

  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.bar {
  height: 25px;
}
textarea{
    outline: none;
    border: none;
    padding: 10px;
    font-size: 15px;
    color: #000;
    resize: none;/*设置不可拉伸*/
}

.btn{
    align-self: flex-end;
    margin-right: 20px;
    transform: translateY(-50%);
    height: 25px;
    width: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
}
</style>
